<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%> 
<html:html>
<head>
		<META http-equiv=Content-Type content="text/html; charset=utf-8">
		<LINK href="../styles/sciencee.css"  type=text/css rel=stylesheet>
		<style type="text/css"></style>
		<title>CGProject</title>
		<html:base/>
</head>
<body>

	<html:form action="/modUser" onsubmit="return  submitModUser()">
	<html:hidden property="regname"/>
	<html:hidden property="empNo"/>
	<table width="100%" cellspacing="1" id="table2" style="border: 1px solid #C0C0C0">
		<tr>
			<td height="25" align="left" bgcolor="#EEF2F7" style="padding:0; " colspan="2" width="100%">&nbsp; 
			<b></b></td>
		</tr>
		<tr>
			<td height="25" align="left" width="10%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; padding:0; ">&nbsp;
			<bean:message key="reguser.name"/></td>
			<td height="25" align="left" style="border-bottom:1px dotted #C0C0C0; padding:0; ">&nbsp;<bean:write name="RegName" scope="request"/></td>
		</tr>
		<tr>
			<td height="25" align="left" width="10%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; padding:0; ">
			&nbsp; <bean:message key="reguser.regid"/>&nbsp;&nbsp; </td>
			<td height="25" align="left" style="border-bottom:1px dotted #C0C0C0; padding:0; ">
			&nbsp;<bean:write name="EmpNo"/></td>
		</tr>
		<tr>
			<td height="25" align="left" width="10%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; padding:0; ">
			&nbsp; <bean:message key="reguser.role"/></td>
			<td height="25" align="left" style="border-bottom:1px dotted #C0C0C0; padding:0; ">
			<html:select property="roles" size="8" style="font-family: Tahoma; font-size: 11px" multiple="true">
					<html:options  collection="AllRoles"
								   property="roleId"
								   labelProperty="roleName"/>
				</html:select><font color=#990000><bean:message key="reguser.role"/>(<bean:message key="reguser.selecttip"/>,<bean:message key="reguser.viewtip"/>)</font></td>
		</tr>
		<tr>
			<td height="25" align="left" width="10%" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; padding:0; ">
			&nbsp; <bean:message key="reguser.defaultrole"/></td>
			<td height="25" align="left" style="border-bottom:1px dotted #C0C0C0; padding:0; ">
			&nbsp;<html:select size="1" property="primary" style="font-family: Tahoma; font-size: 11px">
			<html:options  collection="AllRoles2"
								   property="roleId"
								   labelProperty="roleName"/>
				</html:select></td>
		</tr>
		<tr>
		<td height="25" align="left" style="border-right:1px dotted #C0C0C0; border-bottom:1px dotted #C0C0C0; padding:0; " colspan="2">
			&nbsp;<html:submit style="font-family: Tahoma; font-size: 11px"><bean:message key="modify"/></html:submit>
			<html:reset style="font-family: Tahoma; font-size: 11px"><bean:message key="reset"/></html:reset>
			&nbsp;&nbsp;<html:link page="/index.do"><font face="Verdana" style="font-size: 9pt">[<bean:message key="back"/>]</font></html:link>
			</td>
		</tr>
	</table>
	</html:form>
	</body>
</html:html>
<script language="javascript">

function submitModUser()
{
	  	
  	if(false==checkEmail(modUserForm.email.value))
  	{
  	
  	
  		window.alert("<bean:message key='error.emailunavailable'/>");
  		document.modUserForm.email.focus();
  		return false;  	
   	}  		
  	    	
  	
   	if(modUserForm.roles.options[modUserForm.roles.selectedIndex].value=='0')
  	{
  		window.alert("Please select a role!");
  		document.modUserForm.roleSelect.focus();
  		return false;  
  	}
  	
   	if(modUserForm.Primary.value=="0")
  	{
  		window.alert("Please select the default role!");
  		document.modUserForm.Primary.focus();
  		return false;
  	}
  	window.document.modUserForm.submit();
}
</script>
